<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
        <script src="scripts/scripts1.js" type="text/javascript"></script>
    </head>
    <body>
        <p>
          <?php
        // put your code here
        ?>
        </p>
        <form name="form1" method="post" action="">
          <table width="75%" border="1" cellspacing="2" cellpadding="2">
            <tr>
              <td>Date</td>
              <td><label>
                <input type="text" name="txtDate" id="txtDate" value="<?php echo date("Y-m-d"); ?>">
              </label></td>
            </tr>
            <tr>
              <td colspan="2">
                  <?php
                    require 'lib/util.php';
                    
                    $sql = "SELECT ID, NewsPaperName, Cost FROM inv_NEWS_PAPERS WHERE RecordStatus = 'ACTIVE' ORDER BY Frequency";
                    $rs = executeSqlQuery($sql);
                    $rowCount = mysql_num_rows($rs);
                    
                    if ($rowCount > 0)
                    {
                        ?>
                  <table id="NewsPapers" width="75%" border="1" cellspacing="2" cellpadding="2">
                    <tr>
                      <td>Publication</td>
                      <td>Price</td>
                      <td>Is Purchased?</td>
                    </tr>
                    <?php
                        while ($row = mysql_fetch_array($rs))
                        {
                            echo "<tr>";
                              echo "<td>" . $row['NewsPaperName'] . "</td>";
                              echo "<td><b id=\"cost\">" . $row['Cost']. "</b></td>";
                              echo "<td><input type=\"checkbox\" name=" . $row['NewsPaperName'] . " id=" . $row['ID'] . " value=".$row['Cost']." onchange=\"getTotal(this)\"></input></td>";
                            echo "</tr>";
                        }
                    ?>
                  </table>
                  <?php
                    }
                  ?>
              </td>
            </tr>
            <tr>
              <td>Total</td>
              <td><div id="subTotal">0.00</div></td>
            </tr>
            <tr>
              <td>Note</td>
              <td><label>
                <textarea name="textarea" id="textarea" cols="45" rows="5"></textarea>
              </label></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td><label>
                <input type="submit" name="button" id="button" value="Submit">
              </label></td>
            </tr>
          </table>
    </form>
        <p>&nbsp;    </p>
</body>
</html>
